package cn.edu.cug.cs.gtl.oi.ui.menu;

import javax.swing.*;
import java.awt.event.KeyEvent;

public class JMenuEdit extends JMenu {
    public JMenuEdit() {
        this.setText("编辑(E)");
        this.setMnemonic(KeyEvent.VK_E);
        init();
    }

    void init() {
        JMenuItem ItemRevoke = new JMenuItem("撤销");
        ItemRevoke.setEnabled(false);
        ItemRevoke.setAccelerator(KeyStroke.getKeyStroke('Z', KeyEvent.CTRL_DOWN_MASK));
        this.add(ItemRevoke);

        JMenuItem ItemRecover = new JMenuItem("恢复");
        ItemRecover.setEnabled(false);
        ItemRecover.setAccelerator(KeyStroke.getKeyStroke('Y', KeyEvent.CTRL_DOWN_MASK));
        this.add(ItemRecover);
        this.addSeparator();

        JMenuItem ItemSingleSelect = new JMenuItem("单选");
        ItemSingleSelect.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, 0));
        this.add(ItemSingleSelect);

        JMenuItem ItemBoxSelect = new JMenuItem("框选");
        ItemBoxSelect.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, 0));
        this.add(ItemBoxSelect);

        JMenuItem ItemAllSelect = new JMenuItem("全选");
        ItemAllSelect.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, 0));
        this.add(ItemAllSelect);

        JMenuItem ItemInvertSelect = new JMenuItem("反选");
        ItemInvertSelect.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, 0));
        this.add(ItemInvertSelect);

        JMenuItem ItemClearSelect = new JMenuItem("清除选中");
        this.add(ItemClearSelect);
        this.addSeparator();

        JMenuItem ItemHideSelectObj = new JMenuItem("隐藏选中对象");
        ItemHideSelectObj.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, 0));
        ItemHideSelectObj.setEnabled(false);
        this.add(ItemHideSelectObj);

        JMenuItem ItemShowSelectObj = new JMenuItem("显示隐藏对象");
        ItemShowSelectObj.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_J, 0));
        ItemShowSelectObj.setEnabled(false);
        this.add(ItemShowSelectObj);

        JMenuItem ItemDelSelectObj = new JMenuItem("删除选中对象");
        ItemDelSelectObj.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
        ItemDelSelectObj.setEnabled(false);
        this.add(ItemDelSelectObj);
        this.addSeparator();

        JMenuItem ItemCopySelectObj = new JMenuItem("复制选中对象");
        ItemCopySelectObj.setEnabled(false);
        this.add(ItemCopySelectObj);

        JMenuItem ItemChangeSelectObjCoverage = new JMenuItem("更改选中对象图层");
        ItemChangeSelectObjCoverage.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, 0));
        ItemChangeSelectObjCoverage.setEnabled(false);
        this.add(ItemChangeSelectObjCoverage);
        this.addSeparator();

        JMenuItem ItemClassSelect = new JMenuItem("类别选择");
        this.add(ItemClassSelect);

        JMenuItem ItemPropConditionSelect = new JMenuItem("属性条件选择");
        this.add(ItemPropConditionSelect);

        JMenuItem ItemSearchCoverage = new JMenuItem("查找图元");
        this.add(ItemSearchCoverage);
    }
}
